﻿namespace MobileTrack.Core.Model
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Services.Common;

    [Table("Abonos")]
    [EntityPropertyMapping("Descripcion", SyndicationItemProperty.Title, SyndicationTextContentKind.Plaintext, true)]
    public class Abono : BaseEntity
    {
        public Abono()
        {
            this.Ventas = new List<Venta>();
        }

        public long MarcaId { get; set; }

        [Required]
        [MaxLength(85)]
        public string Descripcion { get; set; }

        public decimal Precio { get; set; }

        [Column(TypeName = "date")]
        public DateTime FechaInicio { get; set; }

        [Column(TypeName = "date")]
        public DateTime FechaFin { get; set; }

        [ForeignKey("MarcaId")]
        public virtual Marca Operador { get; set; }

        public virtual ICollection<Venta> Ventas { get; set; }
    }
}
